﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AfterImage_Player : Afterimage
{
    public override void OnCreate()
    {
        base.OnCreate();
        SpriteController spriteController = Character.Instance.GetComponentInChildren<SpriteController>();
        sourceTransform = spriteController.transform;
        sourceSprite = spriteController.GetComponent<SpriteRenderer>();
    }

    protected override void OnActivate()
    {
        originColor = sourceSprite.color;
        targetColor = originColor.ResetAlpha(0f);
        _deltaColor = (targetColor - originColor) / frame;
        transform.localScale = new Vector3(sourceTransform.localScale.x, 1f, 1f);
        base.OnActivate();
    }
}
